\hypertarget{classduye_1_1_thread_pool}{\section{duye\-:\-:Thread\-Pool Class Reference}
\label{classduye_1_1_thread_pool}\index{duye\-::\-Thread\-Pool@{duye\-::\-Thread\-Pool}}
}


thread pool implemention  




{\ttfamily \#include $<$duye\-\_\-thread\-\_\-pool.\-h$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_thread_pool_abfba1d3824c2ec4bd5844a572e3caa65}{typedef std\-::list$<$ \hyperlink{classduye_1_1_thread_worker}{Thread\-Worker} $\ast$ $>$ \hyperlink{classduye_1_1_thread_pool_abfba1d3824c2ec4bd5844a572e3caa65}{Thread\-Worker\-List}}\label{classduye_1_1_thread_pool_abfba1d3824c2ec4bd5844a572e3caa65}

\begin{DoxyCompactList}\small\item\em thread worker queue \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_thread_pool_ae4fcd687f3fc3815261b1396e07a77e8}{typedef std\-::map$<$ uint32, \\*
\hyperlink{classduye_1_1_thread_worker}{Thread\-Worker} $\ast$ $>$ {\bfseries Thread\-Worker\-Map}}\label{classduye_1_1_thread_pool_ae4fcd687f3fc3815261b1396e07a77e8}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{classduye_1_1_thread_pool_a98af1bb80e296d1429fc9baab052654f}{init} (const uint32 thread\-Count=D\-E\-F\-\_\-\-T\-H\-R\-E\-A\-D\-\_\-\-C\-O\-U\-N\-T)
\begin{DoxyCompactList}\small\item\em init thread pool \end{DoxyCompactList}\item 
bool \hyperlink{classduye_1_1_thread_pool_a098ceb6bc8b493b290d34e9807fb433e}{do\-Job} (\hyperlink{classduye_1_1_thread_job}{Thread\-Job} $\ast$thread\-Job, void $\ast$user\-Data)
\begin{DoxyCompactList}\small\item\em start to do user job \end{DoxyCompactList}\item 
uint32 \hyperlink{classduye_1_1_thread_pool_abe6000ee2eaf565797500dc91849000d}{get\-Thread\-Count} () const 
\begin{DoxyCompactList}\small\item\em get thread count \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_thread_pool_a83e33bd228b06e3ad8be0f918464c175}{uint32 {\bfseries get\-Idle\-Thread\-Count} () const }\label{classduye_1_1_thread_pool_a83e33bd228b06e3ad8be0f918464c175}

\item 
\hypertarget{classduye_1_1_thread_pool_aedc6300b832def48daa9575495640aca}{uint32 {\bfseries get\-Busy\-Thread\-Count} () const }\label{classduye_1_1_thread_pool_aedc6300b832def48daa9575495640aca}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_thread_pool_a5c744212d50d1050f49ec6f7110ccc9a}{class {\bfseries Thread\-Worker}}\label{classduye_1_1_thread_pool_a5c744212d50d1050f49ec6f7110ccc9a}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
thread pool implemention 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_thread_pool_a098ceb6bc8b493b290d34e9807fb433e}{\index{duye\-::\-Thread\-Pool@{duye\-::\-Thread\-Pool}!do\-Job@{do\-Job}}
\index{do\-Job@{do\-Job}!duye::ThreadPool@{duye\-::\-Thread\-Pool}}
\subsubsection[{do\-Job}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Thread\-Pool\-::do\-Job (
\begin{DoxyParamCaption}
\item[{{\bf Thread\-Job} $\ast$}]{thread\-Job, }
\item[{void $\ast$}]{user\-Data}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_thread_pool_a098ceb6bc8b493b290d34e9807fb433e}


start to do user job 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em thread\-Job} & \-: user job object \\
\hline
\mbox{\tt in}  & {\em user\-Data} & \-: user data \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_thread_pool_abe6000ee2eaf565797500dc91849000d}{\index{duye\-::\-Thread\-Pool@{duye\-::\-Thread\-Pool}!get\-Thread\-Count@{get\-Thread\-Count}}
\index{get\-Thread\-Count@{get\-Thread\-Count}!duye::ThreadPool@{duye\-::\-Thread\-Pool}}
\subsubsection[{get\-Thread\-Count}]{\setlength{\rightskip}{0pt plus 5cm}uint32 duye\-::\-Thread\-Pool\-::get\-Thread\-Count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classduye_1_1_thread_pool_abe6000ee2eaf565797500dc91849000d}


get thread count 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em thread\-Job} & \-: user job object \\
\hline
\mbox{\tt in}  & {\em user\-Data} & \-: user data \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the count of thread pool 
\end{DoxyReturn}
\hypertarget{classduye_1_1_thread_pool_a98af1bb80e296d1429fc9baab052654f}{\index{duye\-::\-Thread\-Pool@{duye\-::\-Thread\-Pool}!init@{init}}
\index{init@{init}!duye::ThreadPool@{duye\-::\-Thread\-Pool}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Thread\-Pool\-::init (
\begin{DoxyParamCaption}
\item[{const uint32}]{thread\-Count = {\ttfamily DEF\-\_\-THREAD\-\_\-COUNT}}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_thread_pool_a98af1bb80e296d1429fc9baab052654f}


init thread pool 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em thread\-Count} & \-: thread pool count \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/public/\hyperlink{duye__thread__pool_8h}{duye\-\_\-thread\-\_\-pool.\-h}\end{DoxyCompactItemize}
